1. Field of the Invention
The present invention relates to a filtering method and apparatus for use in decoding the digital signal from the frequency domain to the time domain.
2. Description of the Prior Art
Conventionally, a method for decoding the digital signal in the MP3 (MPEG Audio Layer III) or the like from the frequency domain to the time domain was well known that employed the filtering with a hybrid filter bank.
FIG. 9 is a diagram showing the configuration of functions of an encoder 100 and a decoder 200 in accordance with the MP3 standards. The main functions of the encoder 100 and the decoder 200 will be set forth below with reference to FIG. 9.
In FIG. 9, the encoder 100 comprises a hybrid filter bank (hereinafter referred to as an “HFB”) 110, a psychoacoustic analysis portion 120, an iteration loop 130, a Huffman coding portion 140, a side information coding portion 150, and a stream composing portion 160.
The HFB 110 further comprises a sub-band analysis filter bank 111, an adaptive block length MDCT (Modified Discrete Cosine Transform) 112, and an alias reduction butterfly 113.
The sub-band analysis filter bank 111 cuts out an audio signal input into the encoder 100 by a predetermined window among the windows as shown in FIG. 10, and divides the audio signal from the time domain into a plurality of frequency domains. The adaptive block length MDCT 112 transforms each of these signals into more subdivided frequency spectrum in accordance with a predetermined transformation expression. The alias reduction butterfly 113 makes a predetermined butterfly operation on these frequency spectrum for output to the iteration loop 130. The adaptive block length MDCT 112 makes a transformation process into the frequency spectrum in accordance with weighting of the data based on the analysis result of the psychoacoustic analysis portion 120 (i.e., a bit allocation based on a psychoacoustic model).
The iteration loop 130 makes the non-linear quantization of the input frequency spectrum in accordance with weighting of the data based on the analysis result of the psychoacoustic analysis portion 120. Also, the iteration loop 130 calculates a scale factor (the information regarding the weighting of the data based on the analysis result of the psychoacoustic analysis portion 120) from an output signal (frequency spectrum) of the HFB 110, and outputs it to the side information coding portion 150.
The Huffman coding portion 140 makes the Huffman coding of a signal quantized by the iteration loop 130.
The side information coding portion 150 encodes the side information, including the information regarding the window employed in the adaptive block length MDCT 112, the scale factor of frequency spectrum, and the information regarding a Huffman table used for decoding.
The stream composing portion 160 composes a stream of signals output from the Huffman coding portion 140 and the side information coding portion 150, with CRC (Cyclic Redundancy Check) added, and outputs it to the communication channel or the like.
On the other hand, the decoder 200 comprises a stream decomposing portion 210, a scale factor decoding portion 220, a Huffman table decoding portion 230, a Huffman decoding portion 240, an inverse quantization portion 250, and a hybrid filter bank 260.
The stream decomposing portion 210 decomposes the stream data received from the communication channel into frames.
The scale factor decoding portion 220 decodes a frame regarding the scale factor among the data divided by the stream decomposing portion 210, and outputs the decoded frame to the inverse quantization portion 250.
The Huffman table decoding portion 230 decodes a frame regarding the Huffman table among the data divided by the stream decomposing portion 210, and outputs the decoded frame to the Huffman decoding portion 240.
The Huffman decoding portion 240 makes the Huffman coding of a frame regarding the frequency spectrum of audio signals among the frames decomposed by the reception processing portion 210 on the basis of the information regarding the Huffman table input from the Huffman table decoding portion 230, and outputs the decoded data (Huffman decoded data) to the inverse quantization portion 250.
The inverse quantization portion 250 makes the inverse quantization of the Huffman decoded data on the basis of the scale factor input from the scale factor decoding portion 220 and the Huffman decoded data input from the Huffman decoding portion 240, and outputs the dequantized data to the hybrid filter bank (HFB) 260.
The HFB 260 further comprises an alias reduction butterfly 261, an inverse MDCT 262, and a sub-band synthesis filter bank 263.
The alias reduction butterfly 261 makes a predetermined butterfly operation on the dequantized data input from the inverse quantization portion 250, and outputs the operation result to the inverse MDCT 262.
The inverse MDCT 262 that comprises an inverse MDCT buffer 262a (see FIGS. 12 and 14 as hereinafter described) for use in the processing makes the inverse MDCT of the operation result input from the alias reduction butterfly 261 in accordance with a predetermined transformation expression, and outputs the processed result to the sub-band synthesis filter bank. The inverse MDCT 262 makes a processing corresponding to each of the windows, including a long window and a short window or the like, on the basis of the information regarding the window contained in the side information.
The sub-band synthesis filter bank 263 that comprises a sub-band synthesis buffer 263a makes the sub-band synthesis of the processed result input from the inverse MDCT 262 to be output as an audio signal in the time domain.
Now, the processing in the sub-band synthesis filter bank 263 and the inverse MDCT 262 will be set forth.
The sub-band synthesis filter bank 263 performs an arithmetical operation for an input data stream S in accordance with the following expression:
                              V          ⁡                      (            i            )                          =                              ∑                          k              =              0                        31                    ⁢                                          ⁢                                    S              ⁡                              (                k                )                                      ⁢                          cos              ⁡                              [                                                      π                    /                    64                                    ⁢                                      (                                          i                      +                      16                                        )                                    ⁢                                      (                                                                  2                        ⁢                        k                                            +                      1                                        )                                                  ]                                      ⁢                                                  ⁢                          (                              0                ≤                i                ≤                63                            )                                                          (        1        )            
Expression (1) can be represented in terms of a determinant in the following manner.V=P64×32S  (2)
The sub-band synthesis filter bank 263 calculates an output data stream V (PCM sample data) composed of 32 data blocks from the input data stream S in accordance with the expression (2). At this time, the sub-band synthesis filter bank 263 performs the multiplication by 64×32=2048 times and the addition by 64×31=1984 times.
The input data stream S as above mentioned is the data rearranged at an output signal of the inverse MDCT 262. Namely, one time sample is extracted from each of 32 data blocks contained in the output signal of the inverse MDCT 262, and the extracted data of 32 samples (sample data in the frequency domain) are rearranged to generate the data block in a unit of 32 PCM (Pulse Coded Modulation) samples (sample data in the time domain). This processing is made for all the output signals from the inverse MDCT 262, so that the input data stream S composed of 18 data blocks can be obtained.
Referring now to FIG. 11, a processing in the sub-band synthesis filter bank 263 (i.e., a sub-band synthesis processing) employing the above transformation expression will be described below.
FIG. 11 is a diagram showing a processing procedure in the case where the sub-band synthesis filter bank 263 processes the input data stream S.
In FIG. 11, the sub-band synthesis buffer 263a stores 16 data blocks S0-0 to S0-15 calculated from the input data stream S at the former stage in accordance with the expression (2), each data block being composed of 64 pieces of data.
At first, the sub-band synthesis filter bank 263 shifts the data blocks S0-0 to S0-15 to the right by 64 (one data block) (step S1). Then, the sub-band synthesis filter bank 263 makes the transformation process for the input data stream S in accordance with the expression (2) (step S2), and stores a calculated data block S1-0 in the sub-band synthesis buffer 263a (step S3).
Then, the sub-band synthesis filter bank 263 extracts one-half (512) pieces of data from the data blocks S1-0 to S1-15 stored in the sub-band synthesis buffer 263a (step S4). And the sub-band synthesis filter bank 263 multiplies the extracted 512 pieces of data by the window (step S5), and periodically adds the calculated 512 pieces of data at a period of 32 to output the data block (PCM sample data) composed of 32 pieces of data (step S6).
Also, the inverse MDCT 262 performs the arithmetical operation on the input data stream X in accordance with the following expression.
                              x          ⁡                      (            k            )                          =                              ∑                          j              =              0                                                      N                /                2                            -              1                                ⁢                                          ⁢                                    x              ⁡                              (                j                )                                      ⁢                          cos              ⁡                              [                                                      π                    N                                    ⁢                                      (                                          k                      +                                              1                        /                        2                                            +                                              N                        /                        4                                                              )                                    ⁢                                      (                                          j                      +                                              1                        /                        2                                                              )                                                  ]                                      ⁢                                                  ⁢                          (                              0                ≤                k                ≤                                  N                  -                  1                                            )                                                          (        3        )            where N is equal to 36 (long window) or 12 (short window)
Expression (3) can be represented in terms of a determinant in the following manner.
                                                                                                    ⁢                              x                =                                                      P                                          N                      ×                                              N                        /                        2                                                                              ⁢                  X                                            ⁢                                                                                                                                                        where                  ⁢                                                                          [                                      P                                          N                      ×                                              N                        /                        2                                                                              ]                                                  k                  ,                  j                                            =                              cos                ⁡                                  [                                                            π                      N                                        ⁢                                          (                                              k                        +                                                  1                          /                          2                                                +                                                  N                          /                          4                                                                    )                                        ⁢                                          (                                              j                        +                                                  1                          /                          2                                                                    )                                                        ]                                                                                        (        4        )            
The inverse MDCT 262 calculates an output data stream x composed of 32 data blocks from the input data stream X in accordance with the expression (4). At this time, the inverse MDCT 262 performs the multiplication by 36×18=648 times and the addition by 36×17=612 times, when performing the arithmetical operation employing the window of the long window, or performs the multiplication by 12×6=72 times and the addition by 12×5=60 times, when performing the arithmetical operation employing the window of the short window.
Also, the inverse MDCT 262 makes the data processing (i.e., inverse MDCT processing) as shown in FIGS. 12 and 14 in accordance with the kind of window employed for processing.
FIG. 12 is a diagram showing a processing procedure in the case where the inverse MDCT 262 processes the data block having passed through the long window.
In FIG. 12, the input data stream X is composed of 32 data blocks D1-0 to D1-31, each data block being composed of 18 pieces of data. Also, in FIG. 12, the data block D1-n denotes the “n” th data block among the data blocks D1-0 to D1-31. The same notation is appropriately employed below.
At first, the input data stream X is processed through the inverse MDCT for each data block in accordance with the expression (3), and transformed into the data blocks D2-0 to D2-31 composed of 36 pieces of data. In FIG. 12, the arrow indicated within the data block D2-n indicates the data arranging order. The same notation is appropriately employed below.
Then, the data block processed through the inverse MDCT is multiplied by the predetermined window, and transformed into the data blocks D3-0 to D3-31 composed of 36 pieces of data.
FIG. 13 is a diagram showing the shape of the window to be multiplied in the processing of FIG. 12. As shown in FIG. 13, the windows (normal window, start window, stop window) may be appropriately employed in accordance with the data blocks D2-0 to D2-31.
Of the datablocks D3-0 to D3-31, the latter half 18 pieces of data contained in each data block are stored in the inverse MDCT buffer, while the former half 18 pieces of data are added to the latter half 18 pieces of data in the data block at the former stage, and transformed into the data blocks D4-0 to D4-31 composed of 18 pieces of data.
FIG. 14 is a diagram showing a processing procedure in the case where the inverse MDCT 262 processes the data block having passed through the short window.
In FIG. 14, the input data stream X is composed of 32 data blocks D1-0 to D1-31, each data block being composed of 18 pieces of data, in the same manner as in the long window. However, in the case of the short window, each of the data blocks D1-0 to D1-31 is delimited into three sets at every six pieces of data processed in the same short window, when encoded, each set of delimited data being subjected to the inverse MDCT processing, and multiplied by the window.
FIG. 15 is a diagram showing the shape of the window to be multiplied in the processing of FIG. 14. As shown in FIG. 15, the window multiplied in the processing of FIG. 14 is the short window, and has the shape as shown in FIG. 15.
And each of the data blocks D5-0 to D5-31 composed of three sets of delimited data calculated in this manner is overlapped with and added to the data block at the former stage, as shown in FIG. 14, and transformed into the data blocks D6-0 to D6-31. Moreover, the latter half 12 pieces of data contained in the data blocks D6-0 to D6-31 are stored in the inverse MDCT buffer, and employed for processing the data block at the latter stage.